//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "ioc\rpc.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);

private ["_namespace","_pveh","_locality","_params"];
DEFAULT_PARAM(_namespace,0,"");
// EVENT
// PARAMS
DEFAULT_PARAM(_locality,3,"");

if (IS_STRING(_namespace) && { _namespace != "" }) then {
	if (_locality call FUNC(isRemote)) then {
		_pveh = _namespace call FUNC(getPveh);
		_params = _this;
		_params set [count _params, (getPlayerUid player)];
		missionNamespace setVariable [_pveh, _this];
		publicVariable _pveh;
		TRACE_1("Remotely transmitted",_pveh);
	};
	if (_locality call FUNC(locality)) then {
		_this call FUNC(exec);
		TRACE_1("Locally executed");
	};
};

TRACE("End");